import request from '@/common/js/request.js'

export default {
	
	// 获取我的余额
	getUserBalance() {
		return request({
			url: '/api/course/getBalance',
			method: 'GET',
		})
	},
	
	//支付成功
	orderPay(data) {
		return request({
			url: '/api/course/getPay',
			method: 'POST',
			data //data:data
		})
	},
	
	getOrderInfoWxpay(params){
		return request({
			// url: `/wx/pay/?openid=${prams}`,
			url: '/wx/pay',
			method: 'POST',
			data:params
		})
	},
	//查询用户订单列表
	getUserOrderList(prams){
		return request({
			url: `/wx/getCode/?code=${prams}`,
			method: 'GET',
		})
	},
	
	//添加订单
	//支付成功
	PayOrder(prams) {
		return request({
			url: `/api/order/getPayOrder?orderId=${prams}`,
			method: 'GET',
		})
	},
	
	//查询订单
	getPayOrder(data){
		return request({
			// url: `/api/order/list?courseId=${prams.courseId}&&groupId=${prams.groupId}`,
			url: `/api/order/list`,
			method: 'POST',
			data
		})
	},
	
	//取消订单
	cancelOrder(prams){
		return request({
			url: `/wx/cance?orderId=${prams}`,
			method: 'GET',
		})
	},
	
	//删除订单
	getdeleteOrder(prams){
		return request({
			url: `/api/order/${prams}`,
			method: 'DElETE',
		})
	}
	
}